package com.recipedb.sprint.entity;

import jakarta.persistence.*;
import java.time.LocalDateTime;

@Entity
@Table(name = "points_rewards")
public class PointsRewards {
    @Id
    private Long userid;

    @Column(nullable = false)
    private Integer points = 0;

    private LocalDateTime updatedAt;

    public PointsRewards() {
        this.updatedAt = LocalDateTime.now();
    }

    public PointsRewards(Long userid) {
        this.userid = userid;
        this.points = 0;
        this.updatedAt = LocalDateTime.now();
    }

    public PointsRewards(Long userid, int rewardPoints, LocalDateTime now) {
        this.userid = userid;
        this.points = 0;
        this.updatedAt = LocalDateTime.now();
    }

    public Long getUserid() { return userid; }
    public void setUserid(Long userid) { this.userid = userid; }
    public Integer getPoints() { return points; }
    public void setPoints(Integer points) { this.points = points; }
    public LocalDateTime getUpdatedAt() { return updatedAt; }
    public void setUpdatedAt(LocalDateTime updatedAt) { this.updatedAt = updatedAt; }
}